﻿using System.Windows.Controls;

namespace HomagChina.CCT.Views
{
    /// <summary>
    /// Home.xaml 的交互逻辑
    /// </summary>
    public partial class Home : UserControl
    {
        public Home()
        {
            InitializeComponent();

            //CreateImageCanvasView("05", "CanvasImage/roller_out.png", 18, 345, 140, 70, 1);
            //CreateImageCanvasView("10", "CanvasImage/Shortbeltleft.png", 142, 420, 153, 80, 1);
            //CreateImageCanvasView("15", "CanvasImage/BleltpulleySmallTop.png", 147, 340, 160, 90, 1);
            //CreateImageCanvasView("20", "CanvasImage/OrdinaryRoller_L.png", 155, 175, 160, 175, 1);
            //CreateImageCanvasView("25", "CanvasImage/BleltpulleySmallTop.png", 150, 95, 160, 90, 1);
            //CreateImageCanvasView("30", "CanvasImage/50 .png", 300, 85, 160, 100, 1);
            //CreateImageCanvasView("35", "CanvasImage/lianshihuancun.png", 300, 330, 160, 100, 1);
            //CreateImageCanvasView("ABL220", "CanvasImage/ABL220.png", 455, 35, 630, 230, 1);
            //CreateImageCanvasView("40", "CanvasImage/BeltpulleyBig.png", 450, 320, 180, 120, 1);

            //CreateImageCanvasView("45", "CanvasImage/H330_before.png", 615, 332, 150, 100, 1);
            //CreateImageCanvasView("50", "CanvasImage/OrdinaryRoller.png", 460, 425, 160, 170, 1);
            //CreateImageCanvasView("55", "CanvasImage/BeltpulleyBig.png", 455, 585, 180, 120, 1);
            //CreateImageCanvasView("60", "CanvasImage/H330_before.png", 620, 598, 150, 100, 1);
            //CreateImageCanvasView("H330-1", "CanvasImage/H330.png", 750, 280, 300, 200, 1);
            //CreateImageCanvasView("H330-2", "CanvasImage/H330.png", 755, 550, 300, 200, 1);
            //CreateImageCanvasView("65", "CanvasImage/roller_out.png", 1080, 95, 130, 70, 1);
            //CreateImageCanvasView("70", "CanvasImage/BleltpulleySmallTop.png", 1200, 90, 160, 100, 1);
            //CreateImageCanvasView("75", "CanvasImage/OrdinaryRoller_L.png", 1210, 180, 160, 150, 1);
            //CreateImageCanvasView("80", "CanvasImage/H330_before.png", 1035, 330, 180, 100, 1);
            //CreateImageCanvasView("85", "CanvasImage/H330_before.png", 1035, 600, 180, 100, 1);
            //CreateImageCanvasView("100", "CanvasImage/BleltpulleySmallTop.png", 1205, 320, 180, 130, 1);
            //CreateImageCanvasView("95", "CanvasImage/OrdinaryRoller.png", 1205, 435, 160, 170, 1);
            //CreateImageCanvasView("90", "CanvasImage/BleltpulleySmallTop.png", 1205, 590, 180, 130, 1);
            //CreateImageCanvasView("105", "CanvasImage/BeltpulleySmall.png", 1370, 320, 160, 90, 1);
            //CreateImageCanvasView("110", "CanvasImage/ShortbeltLeft.png", 1380, 400, 140, 80, 1);
        }

        //    CreateSectionCanvasView(100, 630, "10");

        //    CreateSectionCanvasView(380, 640, "20");
        //    CreateSectionCanvasView(380, 570, "25");
        //    CreateSectionCanvasView(600, 640, "30");
        //    CreateSectionCanvasView(600, 570, "35");
        //    CreateSectionCanvasView(370, 390, "40");
        //    CreateSectionCanvasView(380, 220, "50");
        //    CreateSectionCanvasView(380, 140, "55");
        //    CreateSectionCanvasView(600, 220, "60");
        //    CreateSectionCanvasView(600, 140, "65");
        //    CreateSectionCanvasView(1200, 640, "70");
        //    CreateSectionCanvasView(1200, 570, "75");
        //    CreateSectionCanvasView(1200, 390, "80");
        //    CreateSectionCanvasView(1200, 220, "90");
        //    CreateSectionCanvasView(1200, 140, "95");
        //    CreateSectionCanvasView(1320, 160, "100");

        //    CreateSectionCanvasView(700, 220, "201");
        //    CreateSectionCanvasView(700, 140, "202");
        //    CreateSectionCanvasView(1000, 220, "211");
        //    CreateSectionCanvasView(1000, 140, "212");

        //    CreateSectionCanvasView(700, 640, "101");
        //    CreateSectionCanvasView(700, 570, "102");
        //    CreateSectionCanvasView(1000, 640, "111");
        //    CreateSectionCanvasView(1000, 570, "112");

        //    CreateBoard(20, 620);//10
        //    CreateBoard(225, 635);//20
        //    CreateBoard(225, 550);//25
        //    CreateBoard(430, 635);//30
        //    CreateBoard(430, 550);//35
        //    CreateBoard(250, 390);//40
        //    CreateBoard(225, 210);//50
        //    CreateBoard(225, 130);//55
        //    CreateBoard(430, 210);//60
        //    CreateBoard(430, 130);//65
        //    CreateBoard(1060, 635);//70
        //    CreateBoard(1060, 550);//75

        //    CreateBoard(1080, 390);//80
        //    CreateBoard(1060, 210);//90
        //    CreateBoard(1060, 130);//95
        //    CreateBoard(1250, 150);//100
        //    CreateBoard(645, 635);//101
        //    CreateBoard(645, 550);//102
        //    CreateBoard(900, 635);//111
        //    CreateBoard(900, 550);//112

        //    CreateBoard(645, 210);//201
        //    CreateBoard(645, 130);//202
        //    CreateBoard(900, 210);//211
        //    CreateBoard(900, 130);//212

        //}

        //创建图片画布
        //public void CreateImageCanvasView(string Id, string imagePath, int left, int Top, int width, int height)
        //{
        //    Rectangle ImageRectangle = new Rectangle
        //    {
        //        Uid = Id,
        //        Width = width,
        //        Height = height,
        //        Fill = CraeteImageBrushFill(imagePath),
        //        Stroke = Brushes.Black,
        //        StrokeThickness = 0,
        //    };
        //    Canvas.SetLeft(ImageRectangle, left);
        //    Canvas.SetTop(ImageRectangle, Top);
        //    Warehouse.Children.Add(ImageRectangle);
        //}

        //////创建图片画布
        //public void CreateSectionCanvasView(int left, int Top, string text)
        //{
        //    var grid = new Grid();
        //    Ellipse container = new Ellipse
        //    {
        //        Width = 40,
        //        Height = 40,
        //        Fill = Brushes.White,
        //        Stroke = Brushes.Green,
        //        StrokeThickness = 3,
        //    };

        //    TextBlock textBlock = new TextBlock
        //    {
        //        Text = text,
        //        Foreground = Brushes.Green,
        //        Background = Brushes.White,
        //        FontSize = 17,
        //        FontWeight = FontWeights.Bold,
        //        HorizontalAlignment = System.Windows.HorizontalAlignment.Center,
        //        VerticalAlignment = System.Windows.VerticalAlignment.Center
        //    };
        //    grid.Children.Add(container);
        //    grid.Children.Add(textBlock);
        //    Canvas.SetLeft(grid, left);
        //    Canvas.SetTop(grid, Top);
        //    Canvas.SetZIndex(grid, 100000);
        //    Warehouse.Children.Add(grid);
        //}

        //public void CreateBoard(int let, int Top)
        //{
        //    Rectangle BoardRectangle = new Rectangle
        //    {
        //        Uid = "12312312",
        //        Width = 150,
        //        Height = 60,
        //        Fill = GetHexadecimalColor("#d5771e"),
        //        ToolTip = new TextBlock()
        //        {
        //            Text = "Reference:123123\nWidth:100\nHeight:40\nThickness:10",
        //            FontSize = 13,
        //            FontFamily = new FontFamily("Microsoft YaHei"),
        //            HorizontalAlignment = HorizontalAlignment.Center,
        //            VerticalAlignment = VerticalAlignment.Center
        //        }
        //    };
        //    Canvas.SetLeft(BoardRectangle, let);
        //    Canvas.SetTop(BoardRectangle, Top);
        //    Canvas.SetZIndex(BoardRectangle, 10000);
        //    Warehouse.Children.Add(BoardRectangle);
        //}
    }
}